package app.qrcode.browser.todoapp.utils

import android.app.Activity
import android.app.NotificationManager
import android.content.Context
import android.view.inputmethod.InputMethodManager
import androidx.core.content.getSystemService
import app.qrcode.browser.todoapp.App.Companion.appContext
import java.text.SimpleDateFormat

/**
 * Created by YiGo on 2022/5/9.
 */
fun hideKeyBoard(activity: Activity) {
    val inputMethodManager =
        activity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
    val currentFocusedView = activity.currentFocus
    currentFocusedView?.let {
        inputMethodManager.hideSoftInputFromWindow(
            currentFocusedView.windowToken,InputMethodManager.HIDE_NOT_ALWAYS
        )
    }
}

val dateFormater = SimpleDateFormat("yyyy-MM-dd")

val timeFormater=SimpleDateFormat("HH:mm")




